<?php
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
 */

// 登录用的
Route::group(['prefix' => 'v1', 'namespace' => 'Api'], function () {
	// 手机号登录
	Route::post('login/phone', 'UserController@postPhoneLogin');
	// 微信手机号登录
	Route::post('login/wechat', 'UserController@postWxLogin');
	// 微信解密
	Route::post('wechat/encrypt', 'UserController@postEncrypt');
	// 微信code换session
	Route::post('wechat/code', 'UserController@postWxCode');
});

Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => ['jwt']], function () {
	// 用户信息
	Route::post('user/detail', 'UserController@postDetail');
	// 编辑用户信息
	Route::post('user/edit', 'UserController@postEditInfo');
	// 注销
	Route::post('user/logout', 'UserController@postLogout');
});

// 通用功能
Route::group(['prefix' => 'common', 'namespace' => 'Common'], function () {
	// 编辑器文件上传
	Route::get('ueditor_upload', 'FileController@getUeditorupload');
	Route::post('ueditor_upload', 'FileController@postUeditorupload');
	// 文件上传
	Route::post('upload', 'FileController@postFile');
});